package com.sg.service.biz.framework.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.common.util.RedisUtil;
import com.sg.dto.base.framework.req.*;
import com.sg.dto.biz.framework.req.*;
import com.sg.dto.biz.framework.res.*;
import com.sg.dto.integration.component.QueryClassMatchResultToAnswerDetailComReqDto;
import com.sg.dto.integration.component.QueryClassMatchResultToAnswerDetailComRespDto;
import com.sg.service.biz.framework.BusinessAtomService;
import com.wicket.okrcomponent.integration.ConfSchemeService;
import com.wicket.okrframework.common.annotations.BanAuto;
import com.sg.common.exception.Assert;
import com.wicket.okrframework.common.exception.BizException;
import com.wicket.okrframework.dal.po.mbg.*;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Service
public class BaseServiceImpl
        implements com.wicket.okrframework.biz.service.BaseService {

    @Resource
    private RedisUtil redisUtil;
    @Resource
    private MUnionAppService mUnionAppService;
    @Resource
    private MSpaceService mSpaceService;
    @Resource
    private MSceneService mSceneService;
    // @Resource
    // private MSpecMethordTableService mSpecMethordTableService;
    @Resource
    private NbBase nbBase;
    @Resource
    private MOrganizationService mOrganizationService;
    @Resource
    private MBatchService mBatchService;
    @Resource
    private MStatusCheckItemService mStatusCheckItemService;
    @Resource
    private ConfSchemeService confSchemeService;
    @Resource
    private MHypertextContentService mHypertextContentService;
    @Resource
    private MSceneRoleService mSceneRoleService;
    @Resource
    private MPrivacyService mPrivacyService;
    @Resource
    private MPrivacyDistributionService mPrivacyDistributionService;
    @Resource
    private BusinessAtomService businessAtomService;
//@Resource
    //private MCustomFields2Service mCustomFields2Service;
//@Resource
    //private MCustomFieldsService mCustomFieldsService;

    /**
     * D1-2查询联盟应用详情[541]
     * gen by moon at 10/16/2022, 1:02:30 AM
     */
    @Trace(operationName = "D1-2查询联盟应用详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    @Override
    public QueryAppDetailRespDto queryAppDetail(QueryAppDetailReqDto reqDto) {


        UnionApp unionApp_1 = null;
        Space space_1 = null;
        Scene scene_1 = null;
        QueryClassMatchResultToAnswerDetailComRespDto queryClassMatchResultToAnswerDetailComRespDto_1 = null;
        HypertextContent hypertextContent_1 = null;
        HypertextContent hypertextContent_3 = null;
//步骤0: 1-2-06查询联盟应用详情 - queryAppDetail
        UnionApp unionApp = null;
        QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
        if (reqDto != null) {
            queryAppDetailReq.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:7856_1
            queryAppDetailReq.setAppCode(reqDto.getAppCode());//SimpleFieldAssign//sourceId:15205_1
            queryAppDetailReq.setUniqueSpaceId(reqDto.getUniqueSpaceId());//SimpleFieldAssign//sourceId:32764_1
            queryAppDetailReq.setSceneId(reqDto.getSceneId());//SimpleFieldAssign//sourceId:32765_1
            if (reqDto.getWebsite() != null && reqDto.getWebsite().contains("localhost")) {
                //queryAppDetailReq.setWebsite("testnjevc.suzhi.link");
//          queryAppDetailReq.setWebsite("testszhct.suzhi.link");//sourceId:42749_1
                queryAppDetailReq.setWebsite("testxsz.suzhi.link");
//          queryAppDetailReq.setWebsite("hj.suzhi.link");
//          queryAppDetailReq.setWebsite("edu.suzhi.link");
            } else {
                queryAppDetailReq.setWebsite(reqDto.getWebsite());//sourceId:42749_1
            }
        }

        /*1-2-06查询联盟应用详情[168]   */

        unionApp = mUnionAppService.queryAppDetail(queryAppDetailReq);


        unionApp_1 = unionApp;

//步骤1: 1-2-04查询空间详情 - querySpaceDetail
        Space space = null;
        if (unionApp != null && unionApp != null && unionApp.getUniqueSpaceId() != null) {
            QuerySpaceDetailReq querySpaceDetailReq = new QuerySpaceDetailReq();
            if (unionApp != null) {
                querySpaceDetailReq.setSpaceId(unionApp.getUniqueSpaceId());//SimpleFieldAssign//sourceId:33407_1
            }

            /*1-2-04查询空间详情[161]   */
            Assert.isNull(querySpaceDetailReq.getSpaceId(), "D1-2查询联盟应用详情-1-2-04查询空间详情-空间ID不能为空", false);
            space = mSpaceService.querySpaceDetail(querySpaceDetailReq);


            space_1 = space;
        }

//步骤2: 1-2-07查询场景详情 - querySceneDetail
        Scene scene = null;
        if (unionApp != null) {
            QuerySceneDetailReq querySceneDetailReq = new QuerySceneDetailReq();
            if (unionApp != null) {
                querySceneDetailReq.setSceneId(unionApp.getSceneId());//SimpleFieldAssign//sourceId:33430_1
            }

            /*1-2-07查询场景详情[169]   */
            Assert.isNull(querySceneDetailReq.getSceneId(), "D1-2查询联盟应用详情-1-2-07查询场景详情-场景ID不能为空", false);
            scene = mSceneService.querySceneDetail(querySceneDetailReq);


            scene_1 = scene;
        }

//步骤3: D2-3查询分组匹配结果转答案(公共)(跨服务） - queryClassMatchResultToAnswerDetailCom
        QueryClassMatchResultToAnswerDetailComRespDto queryClassMatchResultToAnswerDetailComRespDto = null;
        if (unionApp != null && unionApp != null && unionApp.getUniqueSpaceId() != null) {
            QueryClassMatchResultToAnswerDetailComReqDto queryClassMatchResultToAnswerDetailComReqDto = new QueryClassMatchResultToAnswerDetailComReqDto();
            queryClassMatchResultToAnswerDetailComReqDto.setResultAspObjType("TENANT_SPACE");//sourceId:105831_1
            queryClassMatchResultToAnswerDetailComReqDto.setConfItemClassCode("TRIPLICITIES_SERVICE_CLASS");//CUSTOM_CONVENTION//sourceId:105789_1
            queryClassMatchResultToAnswerDetailComReqDto.setIsInitialScheme("TRUE");//sourceId:308518_1
            queryClassMatchResultToAnswerDetailComReqDto.setIsPlatData("FALSE");//sourceId:308519_1
            if (unionApp != null) {
                queryClassMatchResultToAnswerDetailComReqDto.setResultAspObjId(unionApp.getUniqueSpaceId());//SimpleFieldAssign//sourceId:105830_1
            }

            /*D2-3查询分组匹配结果转答案(公共)(跨服务）[3088]   */
            Assert.isNull(queryClassMatchResultToAnswerDetailComReqDto.getResultAspObjId(), "D1-2查询联盟应用详情-D2-3查询分组匹配结果转答案(公共)(跨服务）-答案归属对象ID不能为空", false);
            Assert.isNull(queryClassMatchResultToAnswerDetailComReqDto.getResultAspObjType(), "D1-2查询联盟应用详情-D2-3查询分组匹配结果转答案(公共)(跨服务）-答案归属对象类型不能为空", false);
            Assert.isNull(queryClassMatchResultToAnswerDetailComReqDto.getConfItemClassCode(), "D1-2查询联盟应用详情-D2-3查询分组匹配结果转答案(公共)(跨服务）-分组标识不能为空", false);
            Assert.isNull(queryClassMatchResultToAnswerDetailComReqDto.getIsInitialScheme(), "D1-2查询联盟应用详情-D2-3查询分组匹配结果转答案(公共)(跨服务）-是否初始方案答案不能为空", false);
            Assert.isNull(queryClassMatchResultToAnswerDetailComReqDto.getIsPlatData(), "D1-2查询联盟应用详情-D2-3查询分组匹配结果转答案(公共)(跨服务）-是否平台数据不能为空", false);
            queryClassMatchResultToAnswerDetailComRespDto = confSchemeService.queryClassMatchResultToAnswerDetailCom(queryClassMatchResultToAnswerDetailComReqDto).getData();


            queryClassMatchResultToAnswerDetailComRespDto_1 = queryClassMatchResultToAnswerDetailComRespDto;
        }

//步骤4: 1-2-15查询超文本内容详情 - queryHypertextContentDetail
        HypertextContent hypertextContent = null;
        if (unionApp != null) {
            QueryHypertextContentDetailReq queryHypertextContentDetailReq = new QueryHypertextContentDetailReq();
            queryHypertextContentDetailReq.setReleationContTypeCode("USER_LOGIN_PROTOCOL");//sourceId:110316_1
            queryHypertextContentDetailReq.setHypertextType("USER_AGREEMENT");//sourceId:179611_1
            if (unionApp != null) {
                queryHypertextContentDetailReq.setReleationContId(unionApp.getAppId());//SimpleFieldAssign//sourceId:110317_1
            }

            /*1-2-15查询超文本内容详情（用户协议）[3133]   */
            Assert.isNull(queryHypertextContentDetailReq.getReleationContTypeCode(), "D1-2查询联盟应用详情-1-2-15查询超文本内容详情（用户协议）-超文本内容关联类型编码不能为空", false);
            Assert.isNull(queryHypertextContentDetailReq.getReleationContId(), "D1-2查询联盟应用详情-1-2-15查询超文本内容详情（用户协议）-超文本内容关联主键ID不能为空", false);
            Assert.isNull(queryHypertextContentDetailReq.getHypertextType(), "D1-2查询联盟应用详情-1-2-15查询超文本内容详情（用户协议）-超文本内容类型不能为空", false);
            hypertextContent = mHypertextContentService.queryHypertextContentDetail(queryHypertextContentDetailReq);


            hypertextContent_1 = hypertextContent;
        }

//步骤5: 1-2-15查询超文本内容详情 - queryHypertextContentDetail
        HypertextContent hypertextContent_2 = null;
        if (unionApp != null) {
            QueryHypertextContentDetailReq queryHypertextContentDetailReq_1 = new QueryHypertextContentDetailReq();
            queryHypertextContentDetailReq_1.setReleationContTypeCode("USER_LOGIN_PROTOCOL");//sourceId:179618_1
            queryHypertextContentDetailReq_1.setHypertextType("PRIVACY_STATEMENT");//sourceId:179623_1
            if (unionApp != null) {
                queryHypertextContentDetailReq_1.setReleationContId(unionApp.getAppId());//SimpleFieldAssign//sourceId:179619_1
            }

            /*1-2-15查询超文本内容详情（隐私声明）[3133]   */
            Assert.isNull(queryHypertextContentDetailReq_1.getReleationContTypeCode(), "D1-2查询联盟应用详情-1-2-15查询超文本内容详情（隐私声明）-超文本内容关联类型编码不能为空", false);
            Assert.isNull(queryHypertextContentDetailReq_1.getReleationContId(), "D1-2查询联盟应用详情-1-2-15查询超文本内容详情（隐私声明）-超文本内容关联主键ID不能为空", false);
            Assert.isNull(queryHypertextContentDetailReq_1.getHypertextType(), "D1-2查询联盟应用详情-1-2-15查询超文本内容详情（隐私声明）-超文本内容类型不能为空", false);
            hypertextContent_2 = mHypertextContentService.queryHypertextContentDetail(queryHypertextContentDetailReq_1);


            hypertextContent_3 = hypertextContent_2;
        }

        QueryAppDetailRespDto retData = new QueryAppDetailRespDto();
        if (unionApp_1 != null) {
            retData.setAppId(unionApp_1.getAppId());//SimpleFieldAssign//sourceId:15233_1
            retData.setAppCode(unionApp_1.getAppCode());//SimpleFieldAssign//sourceId:15245_1
            retData.setAppName(unionApp_1.getAppName());//SimpleFieldAssign//sourceId:15234_1
            retData.setAppIntroduce(unionApp_1.getAppIntroduce());//SimpleFieldAssign//sourceId:15235_1
            retData.setAppUpdateIntroduct(unionApp_1.getAppUpdateIntroduct());//SimpleFieldAssign//sourceId:15236_1
            retData.setWebsite(unionApp_1.getWebsite());//SimpleFieldAssign//sourceId:15237_1
            retData.setAppLogo(unionApp_1.getAppLogo());//SimpleFieldAssign//sourceId:15238_1
            retData.setAboutLogo(unionApp_1.getAboutLogo());//SimpleFieldAssign//sourceId:15239_1
            retData.setAppBanner(unionApp_1.getAppBanner());//SimpleFieldAssign//sourceId:15246_1
            retData.setAppBigBanner(unionApp_1.getAppBigBanner());//SimpleFieldAssign//sourceId:62236_1
            retData.setServicePhone(unionApp_1.getServicePhone());//SimpleFieldAssign//sourceId:15240_1
            retData.setServiceTime(unionApp_1.getServiceTime());//SimpleFieldAssign//sourceId:15241_1
            retData.setCopyright(unionApp_1.getCopyright());//SimpleFieldAssign//sourceId:15242_1
            retData.setAppVersion(unionApp_1.getAppVersion());//SimpleFieldAssign//sourceId:15243_1
            retData.setSubjectLifeCycle(unionApp_1.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:15249_1
            retData.setUniqueSpaceId(unionApp_1.getUniqueSpaceId());//SimpleFieldAssign//sourceId:15244_1
            retData.setSceneId(unionApp_1.getSceneId());//SimpleFieldAssign//sourceId:32983_1
            retData.setPlatformType(unionApp_1.getPlatformType());//SimpleFieldAssign//sourceId:15252_1
            retData.setOperationInductionId(unionApp_1.getOperationInductionId());//SimpleFieldAssign//sourceId:15250_1
            retData.setOperateTime(unionApp_1.getOperateTime());//SimpleFieldAssign//sourceId:15251_1
            retData.setSenderMemberId(unionApp_1.getSenderMemberId());//SimpleFieldAssign//sourceId:15251_1
        }
        if (space_1 != null) {
            retData.setSpaceName(space_1.getSpaceName());//SimpleFieldAssign//sourceId:33454_1
            // TODO: 2022/12/16 手动代码
            retData.setAbbreviation(space_1.getAbbreviation());
        }
        if (scene_1 != null) {
            retData.setSceneName(scene_1.getSceneName());//SimpleFieldAssign//sourceId:33455_1
        }
        if (queryClassMatchResultToAnswerDetailComRespDto_1 != null) {
            retData.setIsOpenSmsService(queryClassMatchResultToAnswerDetailComRespDto_1.getIsOpenSmsService());//SimpleFieldAssign//sourceId:105840_1
            retData.setIsUsePlatformSmsService(queryClassMatchResultToAnswerDetailComRespDto_1.getIsUsePlatformSmsService());//SimpleFieldAssign//sourceId:105842_1
        }
        if (hypertextContent_1 != null) {
            retData.setUserAgreement(hypertextContent_1.getHypertextContent());//SimpleFieldAssign//sourceId:110325_1
        }
        if (hypertextContent_3 != null) {
            retData.setPrivacyStatement(hypertextContent_3.getHypertextContent());//SimpleFieldAssign//sourceId:179624_1
        }


        return retData;
    }

    /**
     * D1-2查询空间详情
     */
    @Trace(operationName = "D1-2查询空间详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class, noRollbackFor = BizException.class)
    @Override
    public QuerySpaceDetailRespDto querySpaceDetail(QuerySpaceDetailReqDto reqDto) {


        Space space_1 = null;
        Scene scene_1 = null;
        UnionApp unionApp_1 = null;
//步骤0: 1-2-04查询空间详情 - querySpaceDetail
        QuerySpaceDetailReq querySpaceDetailReq = new QuerySpaceDetailReq();
        querySpaceDetailReq.setIsInvalid("FALSE");
        if (reqDto != null) {
            querySpaceDetailReq.setSpaceId(reqDto.getSpaceId());
            querySpaceDetailReq.setSpaceCode(reqDto.getSpaceCode());
            querySpaceDetailReq.setOrganizationNumber(reqDto.getOrganizationNumber());
            querySpaceDetailReq.setSpaceLogo(reqDto.getSpaceLogo());
        }

        /*1-2-04查询空间详情[161]   */
        Space space = mSpaceService.querySpaceDetail(querySpaceDetailReq);

        space_1 = space;

//步骤1: 1-2-07查询场景详情 - querySceneDetail
        QuerySceneDetailReq querySceneDetailReq = new QuerySceneDetailReq();
        querySceneDetailReq.setSubjectLifeCycle("CURRENTLY_VALID");
        if (space != null) {
            querySceneDetailReq.setSceneId(space.getSubjectionSceneId());
        }

        /*1-2-07查询场景详情[169]   */
        Scene scene = mSceneService.querySceneDetail(querySceneDetailReq);

        scene_1 = scene;

//步骤2: 1-2-06查询联盟应用详情 - queryAppDetail
        QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
        if (space != null) {
            queryAppDetailReq.setAppId(space.getSubjectionAppId());
        }

        /*1-2-06查询联盟应用详情[168]   */
        UnionApp unionApp = mUnionAppService.queryAppDetail(queryAppDetailReq);

        unionApp_1 = unionApp;

        QuerySpaceDetailRespDto retData = new QuerySpaceDetailRespDto();
        if (space_1 != null) {
            retData.setSpaceId(space_1.getSpaceId());
            retData.setOrganizationNumber(space_1.getOrganizationNumber());
            retData.setSpaceName(space_1.getSpaceName());
            retData.setAbbreviation(space_1.getAbbreviation());
            retData.setSpaceLogo(space_1.getSpaceLogo());
            retData.setSpaceCopyRight(space_1.getSpaceCopyRight());
            retData.setPlatformType(space_1.getPlatformType());
            retData.setIsInvalid(space_1.getIsInvalid());
            retData.setIsInvalidReason(space_1.getIsInvalidReason());
            retData.setIsInvalidTime(space_1.getIsInvalidTime());
            retData.setInvalidType(space_1.getInvalidType());
            retData.setSubjectionSceneId(space_1.getSubjectionSceneId());
            retData.setSubjectionAppId(space_1.getSubjectionAppId());
            retData.setCreateInductionId(space_1.getCreateInductionId());
            retData.setCreateTime(space_1.getCreateTime());
            retData.setAscriptionSpaceId(space_1.getAscriptionSpaceId());
            retData.setAppId(space_1.getAppId());
            retData.setSpaceCode(space_1.getSpaceCode());
        }
        if (scene_1 != null) {
            retData.setSceneName(scene_1.getSceneName());
            retData.setSenceCode(scene_1.getSenceCode());
        }
        if (unionApp_1 != null) {
            retData.setAppName(unionApp_1.getAppName());
            retData.setAppCode(unionApp_1.getAppCode());
//            retData.setIsEnableSms(unionApp_1.getIsEnableSms());
        }


        return retData;
    }

    /**
     * D1-2查询空间列表[434]
     * gen by moon at 8/10/2022, 3:23:24 AM
     */
    @Trace(operationName = "D1-2查询空间列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySpaceListRespDto querySpaceList(QuerySpaceListReqDto reqDto) {


        List<Space> listSpace_1 = new ArrayList<>();
//步骤0: 1-2-04查询空间列表 - querySpaceList
        List<Space> listSpace = new ArrayList<>();
        QuerySpaceListReq querySpaceListReq = new QuerySpaceListReq();
        if (reqDto != null) {
            querySpaceListReq.setSpaceName(reqDto.getSpaceName());//sourceId:32468_1
            querySpaceListReq.setPlatformType(reqDto.getPlatformType());//sourceId:32469_1
            querySpaceListReq.setIsInvalid(reqDto.getIsInvalid());//sourceId:32470_1
            querySpaceListReq.setSubjectionSceneId(reqDto.getSubjectionSceneId());//sourceId:32471_1
            querySpaceListReq.setSubjectionAppId(reqDto.getSubjectionAppId());//sourceId:32472_1
        }

        /*1-2-04查询空间列表[60]   */

        listSpace = mSpaceService.querySpaceList(querySpaceListReq);

        listSpace_1 = listSpace;

        QuerySpaceListRespDto retData = new QuerySpaceListRespDto();
        retData.setSpaceList(listSpace_1.stream().map(item -> BeanUtil.toBean(item, FrameworkSpaceDto.class)).collect(Collectors.toList()));//sourceId:32474_1


        return retData;
    }

    /**
     * D1-2查场景列表（公共）
     */
    @Trace(operationName = "D1-2查场景列表（公共）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class, noRollbackFor = BizException.class)
    @Override
    public QuerySceneListComRespDto querySceneListCom(QuerySceneListComReqDto reqDto) {

        // 步骤0: 1-2-07查询场景列表 - querySceneList
        QuerySceneListReq querySceneListReq = new QuerySceneListReq();
        if (reqDto != null) {
            querySceneListReq.setPlatformType(reqDto.getPlatformType());
            querySceneListReq.setAscriptionAppId(reqDto.getAscriptionAppId());
            querySceneListReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());
        }

        /* 1-2-07查询场景列表 */
        List<Scene> listScene = mSceneService.querySceneList(querySceneListReq);

        QuerySceneListComRespDto retData = new QuerySceneListComRespDto();
        retData.setSenceList(
                listScene.stream().map(item -> BeanUtil.toBean(item, SenceDto.class)).collect(Collectors.toList()));

        return retData;
    }

    /**
     * D1-2修改联盟应用[568]
     * gen by moon at 12/3/2022, 4:36:53 PM
     */
    @Trace(operationName = "D1-2修改联盟应用")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public UpdateAppRespDto updateApp(UpdateAppReqDto reqDto) {


        //virtualUsage 1-2-06修改联盟应用  1326
        boolean bOOLEAN;
        UnionApp unionApp = new UnionApp();
        if (reqDto != null) {
            unionApp.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:11618_1_1326
            unionApp.setAppCode(reqDto.getAppCode());//SimpleFieldAssign//sourceId:11619_1_1326
            unionApp.setAppName(reqDto.getAppName());//SimpleFieldAssign//sourceId:11620_1_1326
            unionApp.setAppIntroduce(reqDto.getAppIntroduce());//SimpleFieldAssign//sourceId:11621_1_1326
            unionApp.setAppUpdateIntroduct(reqDto.getAppUpdateIntroduct());//SimpleFieldAssign//sourceId:11622_1_1326
            unionApp.setWebsite(reqDto.getWebsite());//SimpleFieldAssign//sourceId:11623_1_1326
            unionApp.setAppLogo(reqDto.getAppLogo());//SimpleFieldAssign//sourceId:11624_1_1326
            unionApp.setAboutLogo(reqDto.getAboutLogo());//SimpleFieldAssign//sourceId:11625_1_1326
            unionApp.setAppBanner(reqDto.getAppBanner());//SimpleFieldAssign//sourceId:11626_1_1326
            unionApp.setAppBigBanner(reqDto.getAppBigBanner());//SimpleFieldAssign//sourceId:62222_1_1326
            unionApp.setServicePhone(reqDto.getServicePhone());//SimpleFieldAssign//sourceId:11627_1_1326
            unionApp.setServiceTime(reqDto.getServiceTime());//SimpleFieldAssign//sourceId:11628_1_1326
            unionApp.setCopyright(reqDto.getCopyright());//SimpleFieldAssign//sourceId:11629_1_1326
            unionApp.setPlatformType(reqDto.getPlatformType());//SimpleFieldAssign//sourceId:11632_1_1326
            unionApp.setAppVersion(reqDto.getAppVersion());//SimpleFieldAssign//sourceId:11630_1_1326
            unionApp.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:11693_1_1326
            unionApp.setIsArchive(reqDto.getIsArchive());//SimpleFieldAssign//sourceId:33072_1_1326
            unionApp.setUniqueSpaceId(reqDto.getUniqueSpaceId());//SimpleFieldAssign//sourceId:15376_1_1326
            unionApp.setSceneId(reqDto.getSceneId());//SimpleFieldAssign//sourceId:33073_1_1326
        }

        /*1-2-06修改联盟应用[66]   */
        Assert.isNull(unionApp.getAppId(), "D1-2修改联盟应用-1-2-06修改联盟应用-应用ID不能为空", false);
        bOOLEAN = mUnionAppService.updateApp(unionApp);


        if ((reqDto != null && reqDto.getSubjectLifeCycle() != null && reqDto.getSubjectLifeCycle().equals("CURRENTLY_VALID"))) {
            //if(D1-2修改联盟应用.主体生命周期 等于 当前有效)  1327

            UnionApp unionApp_1 = null;
            QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
            if (reqDto != null) {
                queryAppDetailReq.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:46888_1_1328
            }

            /*1-2-06查询联盟应用详情[168]   */
            Assert.isNull(queryAppDetailReq.getAppId(), "D1-2修改联盟应用-1-2-06查询联盟应用详情-应用ID不能为空", false);
            unionApp_1 = mUnionAppService.queryAppDetail(queryAppDetailReq);


            if ((unionApp_1 != null && unionApp_1.getPlatformType() != null && unionApp_1.getPlatformType().equals("TRUE"))) {
                //if(1-2-06查询联盟应用详情.是否平台应用 等于 是)  1329

                List<Space> listSpace = new ArrayList<>();
                QuerySpaceListReq querySpaceListReq = new QuerySpaceListReq();
                if (reqDto != null) {
                    querySpaceListReq.setSubjectionAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:46885_1_1330
                }

                /*1-2-04查询空间列表[60]   */
                Assert.isNull(querySpaceListReq.getSubjectionAppId(), "D1-2修改联盟应用-1-2-04查询空间列表-隶属联盟应用ID不能为空", false);
                listSpace = mSpaceService.querySpaceList(querySpaceListReq);


//ModelCode: batchClearSpaceInfoFromRedis
                BatchClearSpaceInfoFromRedisRespDto batchClearSpaceInfoFromRedisRes = null;
                if (listSpace != null && !CollectionUtil.isEmpty(listSpace) && listSpace.size() > 0) {
                    BatchClearSpaceInfoFromRedisReqDto batchClearSpaceInfoFromRedisReq = new BatchClearSpaceInfoFromRedisReqDto();
                    batchClearSpaceInfoFromRedisReq.setSpaceInfoToRedisList(listSpace.stream().map(item -> item.getSpaceId())
                            .collect(Collectors.toList()));/*list-to-strings*///sourceId:106787_1_5693

                    /*M-批量Redis清空空间信息（特殊方法）[3103]  用于批量入参空间，清除对应空间在redis的缓存信息 */

                    batchClearSpaceInfoFromRedisRes = nbBase.batchClearSpaceInfoFromRedis(batchClearSpaceInfoFromRedisReq);


                }
            } else {
                //else  1333

//ModelCode: clearSpaceInfoFromRedis
                ClearSpaceInfoFromRedisRespDto clearSpaceInfoFromRedisRes = null;
                if (unionApp_1 != null) {
                    ClearSpaceInfoFromRedisReqDto clearSpaceInfoFromRedisReq = new ClearSpaceInfoFromRedisReqDto();
                    if (unionApp_1 != null) {
                        clearSpaceInfoFromRedisReq.setSpaceId(unionApp_1.getUniqueSpaceId());//SimpleFieldAssign//sourceId:106786_1_1334
                    }

                    /*M-Redis清空空间信息（特殊方法）[1555]  用于清空REDIS中空间缓存信息，在空间信息修改时触发 */
                    Assert.isNull(clearSpaceInfoFromRedisReq.getSpaceId(), "D1-2修改联盟应用-M-Redis清空空间信息（特殊方法）-空间ID不能为空", false);
                    clearSpaceInfoFromRedisRes = nbBase.clearSpaceInfoFromRedis(clearSpaceInfoFromRedisReq);


                }
            }
//processBranchName:正常结束 ,processBranchId:23507

        } else {
            //else  1336

//processBranchName:正常结束 ,processBranchId:1337

        }
        UpdateAppRespDto retData = new UpdateAppRespDto();


        return retData;
    }

    /**
     * D1-2新增联盟应用[557]
     * gen by moon at 12/2/2022, 5:00:10 PM
     */
    @Trace(operationName = "D1-2新增联盟应用")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public AddAppRespDto addApp(AddAppReqDto reqDto) {


        String string_1 = null;
//步骤0: 1-2-06新增联盟应用 - addApp
        String string = null;
        UnionApp unionApp = new UnionApp();
        if (reqDto != null) {
            unionApp.setAppName(reqDto.getAppName());//SimpleFieldAssign//sourceId:15316_1
            unionApp.setAppIntroduce(reqDto.getAppIntroduce());//SimpleFieldAssign//sourceId:15317_1
            unionApp.setAppUpdateIntroduct(reqDto.getAppUpdateIntroduct());//SimpleFieldAssign//sourceId:15318_1
            unionApp.setWebsite(reqDto.getWebsite());//SimpleFieldAssign//sourceId:15319_1
            unionApp.setAppLogo(reqDto.getAppLogo());//SimpleFieldAssign//sourceId:15320_1
            unionApp.setAboutLogo(reqDto.getAboutLogo());//SimpleFieldAssign//sourceId:15321_1
            unionApp.setAppBanner(reqDto.getAppBanner());//SimpleFieldAssign//sourceId:15322_1
            unionApp.setAppBigBanner(reqDto.getAppBigBanner());//SimpleFieldAssign//sourceId:62275_1
            unionApp.setServicePhone(reqDto.getServicePhone());//SimpleFieldAssign//sourceId:15323_1
            unionApp.setServiceTime(reqDto.getServiceTime());//SimpleFieldAssign//sourceId:15324_1
            unionApp.setCopyright(reqDto.getCopyright());//SimpleFieldAssign//sourceId:15325_1
            unionApp.setAppVersion(reqDto.getAppVersion());//SimpleFieldAssign//sourceId:15326_1
            unionApp.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:15329_1
            unionApp.setPlatformType(reqDto.getPlatformType());//SimpleFieldAssign//sourceId:15328_1
            unionApp.setUniqueSpaceId(reqDto.getUniqueSpaceId());//SimpleFieldAssign//sourceId:33383_1
            unionApp.setSceneId(reqDto.getSceneId());//SimpleFieldAssign//sourceId:33384_1
        }

        /*1-2-06新增联盟应用[65]   */
        Assert.isNull(unionApp.getAppName(), "D1-2新增联盟应用-1-2-06新增联盟应用-应用名称不能为空", false);
        Assert.isNull(unionApp.getAppLogo(), "D1-2新增联盟应用-1-2-06新增联盟应用-应用框架logo图片不能为空", false);
        Assert.isNull(unionApp.getAboutLogo(), "D1-2新增联盟应用-1-2-06新增联盟应用-关于我们logo图片不能为空", false);
        Assert.isNull(unionApp.getAppBanner(), "D1-2新增联盟应用-1-2-06新增联盟应用-应用登录banner不能为空", false);
        Assert.isNull(unionApp.getCopyright(), "D1-2新增联盟应用-1-2-06新增联盟应用-版权信息不能为空", false);
        Assert.isNull(unionApp.getAppVersion(), "D1-2新增联盟应用-1-2-06新增联盟应用-应用版本信息不能为空", false);
        Assert.isNull(unionApp.getSubjectLifeCycle(), "D1-2新增联盟应用-1-2-06新增联盟应用-主体生命周期不能为空", false);
        Assert.isNull(unionApp.getPlatformType(), "D1-2新增联盟应用-1-2-06新增联盟应用-是否平台应用不能为空", false);
        string = mUnionAppService.addApp(unionApp);


        string_1 = string;

        AddAppRespDto retData = new AddAppRespDto();
        if (string_1 != null) {
            retData.setAppId(string_1);//SimpleFieldAssign//sourceId:33021_1
        }


        return retData;
    }

    /**
     * D1-2查询联盟应用列表[539]
     * gen by moon at 8/10/2022, 3:23:45 AM
     */
    @Trace(operationName = "D1-2查询联盟应用列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QueryAppListRespDto queryAppList(QueryAppListReqDto reqDto) {


        List<UnionApp> listUnionApp_1 = new ArrayList<>();
//步骤0: 1-2-06查询联盟应用列表 - queryAppList
        List<UnionApp> listUnionApp = new ArrayList<>();
        QueryAppListReq queryAppListReq = new QueryAppListReq();
        if (reqDto != null) {
            queryAppListReq.setAppName(reqDto.getAppName());//sourceId:12900_1
            queryAppListReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:12901_1
            queryAppListReq.setPlatformType(reqDto.getPlatformType());//sourceId:12903_1
            queryAppListReq.setIsArchive(reqDto.getIsArchive());//sourceId:15187_1
        }

        /*1-2-06查询联盟应用列表[68]   */

        listUnionApp = mUnionAppService.queryAppList(queryAppListReq);

        listUnionApp_1 = listUnionApp;

        QueryAppListRespDto retData = new QueryAppListRespDto();
        retData.setUnionAppList(listUnionApp_1.stream().map(item -> BeanUtil.toBean(item, UnionAppDto.class)).collect(Collectors.toList()));//sourceId:12937_1


        return retData;
    }

    /**
     * D1-2修改空间[439]
     * gen by moon at 10/2/2022, 6:40:56 AM
     */
    @Trace(operationName = "D1-2修改空间")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public UpdateSpaceRespDto updateSpace(UpdateSpaceReqDto reqDto) {


        //步骤0: 1-2-04修改空间 - updateSpace
        boolean bOOLEAN;
        Space space = new Space();
        if (reqDto != null) {
            space.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:15841_1
            space.setSpaceCode(reqDto.getSpaceCode());//SimpleFieldAssign//sourceId:15842_1
            space.setOrganizationNumber(reqDto.getOrganizationNumber());//SimpleFieldAssign//sourceId:32544_1
            space.setSpaceName(reqDto.getSpaceName());//SimpleFieldAssign//sourceId:15843_1
            space.setAbbreviation(reqDto.getAbbreviation());//SimpleFieldAssign//sourceId:15844_1
            space.setSpaceLogo(reqDto.getSpaceLogo());//SimpleFieldAssign//sourceId:15845_1
            space.setSpaceCopyRight(reqDto.getSpaceCopyRight());//SimpleFieldAssign//sourceId:15846_1
            space.setIsInvalid(reqDto.getIsInvalid());//SimpleFieldAssign//sourceId:15848_1
            space.setIsInvalidReason(reqDto.getIsInvalidReason());//SimpleFieldAssign//sourceId:15849_1
            space.setIsInvalidTime(reqDto.getIsInvalidTime());//SimpleFieldAssign//sourceId:15850_1
            space.setInvalidType(reqDto.getInvalidType());//SimpleFieldAssign//sourceId:15851_1
        }

        /*1-2-04修改空间[58]   */
        Assert.isNull(space.getSpaceId(), "D1-2修改空间-1-2-04修改空间-空间ID不能为空", false);
        bOOLEAN = mSpaceService.updateSpace(space);


//步骤1: M-Redis清空空间信息（特殊方法） - clearSpaceInfoFromRedis
        //ModelCode: clearSpaceInfoFromRedis
        ClearSpaceInfoFromRedisRespDto clearSpaceInfoFromRedisRes = null;
        ClearSpaceInfoFromRedisReqDto clearSpaceInfoFromRedisReq = new ClearSpaceInfoFromRedisReqDto();
        if (reqDto != null) {
            clearSpaceInfoFromRedisReq.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:106783_1
        }

        /*M-Redis清空空间信息（特殊方法）[1555]  用于清空REDIS中空间缓存信息，在空间信息修改时触发 */
        Assert.isNull(clearSpaceInfoFromRedisReq.getSpaceId(), "D1-2修改空间-M-Redis清空空间信息（特殊方法）-空间ID不能为空", false);
        clearSpaceInfoFromRedisRes = nbBase.clearSpaceInfoFromRedis(clearSpaceInfoFromRedisReq);


        UpdateSpaceRespDto retData = new UpdateSpaceRespDto();


        return retData;
    }

    /**
     * D1-2新增空间（平台）[436]
     * gen by moon at 1/24/2024, 3:47:41 AM
     */
    @Trace(operationName = "D1-2新增空间（平台）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public AddSpaceRespDto addSpace(AddSpaceReqDto reqDto) {


        String string_1 = null;
        String string_3 = null;
//步骤0: 1-2-04新增空间 - addSpace
        String string = null;
        Space space = new Space();
        if (reqDto != null) {
            space.setOrganizationNumber(reqDto.getOrganizationNumber());//SimpleFieldAssign//sourceId:32511_1
            space.setSpaceName(reqDto.getSpaceName());//SimpleFieldAssign//sourceId:15827_1
            space.setAbbreviation(reqDto.getAbbreviation());//SimpleFieldAssign//sourceId:15828_1
            space.setSpaceLogo(reqDto.getSpaceLogo());//SimpleFieldAssign//sourceId:15964_1
            space.setSpaceCopyRight(reqDto.getSpaceCopyRight());//SimpleFieldAssign//sourceId:15829_1
            space.setPlatformType(reqDto.getPlatformType());//SimpleFieldAssign//sourceId:15830_1
            space.setSubjectionSceneId(reqDto.getSubjectionSceneId());//SimpleFieldAssign//sourceId:15831_1
            space.setSubjectionAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:16278_1
        }

        /*1-2-04新增空间[57] 新增空间，前端选择场景ID，以及联盟应用ID，作为部分入参  */
        Assert.isNull(space.getOrganizationNumber(), "D1-2新增空间（平台）-1-2-04新增空间-空间编号不能为空", false);
        Assert.isNull(space.getSpaceName(), "D1-2新增空间（平台）-1-2-04新增空间-空间名称不能为空", false);
        Assert.isNull(space.getAbbreviation(), "D1-2新增空间（平台）-1-2-04新增空间-空间简称不能为空", false);
        Assert.isNull(space.getSpaceLogo(), "D1-2新增空间（平台）-1-2-04新增空间-头像logo不能为空", false);
        Assert.isNull(space.getPlatformType(), "D1-2新增空间（平台）-1-2-04新增空间-是否是平台不能为空", false);
        Assert.isNull(space.getSubjectionSceneId(), "D1-2新增空间（平台）-1-2-04新增空间-隶属场景id不能为空", false);
        string = mSpaceService.addSpace(space)/*vcase invoke 本地 method 方法调用;*/;


        string_1 = string;

//步骤1: 1-3-12新增组织 - addOrg
        String string_2 = null;
        if (string != null) {
            Organization organization = new Organization();
            organization.setOrganizationCode("10011001");//CUSTOM_CONVENTION//sourceId:16011_1
            organization.setCurrentManageObjectType("DEPTMENT");//sourceId:216219_1
            organization.setGlobalLockStatus("UNLOCK");//sourceId:837859_1
            organization.setManageLockStatus("UNLOCK");//sourceId:216220_1
            organization.setIsHighOrg("TRUE");//sourceId:41203_1
            organization.setUsingLockStatus("AUTO_LOCK");//sourceId:216221_1
            organization.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:216222_1
            organization.setBatchProcessProgress(Long.valueOf(0));//CUSTOM_CONVENTION//sourceId:264423_1
            if (reqDto != null) {
                organization.setOrganizationNumber(reqDto.getOrganizationNumber());//SimpleFieldAssign//sourceId:16012_1
                organization.setOrganizationName(reqDto.getSpaceName());//SimpleFieldAssign//sourceId:16013_1
                organization.setAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:16019_1
            }
            if (string != null) {
                organization.setSpaceId(string);//SimpleFieldAssign//sourceId:16018_1
            }

            /*1-3-12新增组织[196] 创建组织，把空间名称作为组织名称、把机构编码作为组织编号、把空间标识作为组织标识 入参；  */
            Assert.isNull(organization.getOrganizationCode(), "D1-2新增空间（平台）-1-3-12新增组织-组织标识不能为空", false);
            Assert.isNull(organization.getOrganizationNumber(), "D1-2新增空间（平台）-1-3-12新增组织-组织编号不能为空", false);
            Assert.isNull(organization.getOrganizationName(), "D1-2新增空间（平台）-1-3-12新增组织-组织名称不能为空", false);
            Assert.isNull(organization.getCurrentManageObjectType(), "D1-2新增空间（平台）-1-3-12新增组织-当前管理对象类型不能为空", false);
            Assert.isNull(organization.getManageLockStatus(), "D1-2新增空间（平台）-1-3-12新增组织-管理锁定状态不能为空", false);
            Assert.isNull(organization.getIsHighOrg(), "D1-2新增空间（平台）-1-3-12新增组织-是否最高组织不能为空", false);
            Assert.isNull(organization.getUsingLockStatus(), "D1-2新增空间（平台）-1-3-12新增组织-使用锁定状态不能为空", false);
            Assert.isNull(organization.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-3-12新增组织-主体生命周期不能为空", false);
            Assert.isNull(organization.getBatchProcessProgress(), "D1-2新增空间（平台）-1-3-12新增组织-批次处理进度不能为空", false);
            Assert.isNull(organization.getSpaceId(), "D1-2新增空间（平台）-1-3-12新增组织-创建于空间ID不能为空", false);
            Assert.isNull(organization.getAppId(), "D1-2新增空间（平台）-1-3-12新增组织-创建于联盟应用ID不能为空", false);
            string_2 = mOrganizationService.addOrg(organization)/*vcase invoke 本地 method 方法调用;*/;


            string_3 = string_2;
        }

//步骤2: 1-1-22批量新增状态校验项 - batchAddCheckItemStat
        boolean bOOLEAN;
        if (string_2 != null) {
            List<StatusCheckItem> listStatusCheckItem = new ArrayList<>();
            if (reqDto != null) {
                //simpleList-to-objLists
                for (String item : reqDto.getCheckItemStatList()) {
                    StatusCheckItem oneItem = new StatusCheckItem();
                    oneItem.setObjectTypeCode("ORG_CHECK");//sourceId:14396_2
                    if (reqDto != null) {
                        oneItem.setCheckItemCode(item);//SimpleFieldAssign//sourceId:7151_2
                        oneItem.setAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:107919_2
                    }
                    if (string_2 != null) {
                        oneItem.setEntityId(string_2);//SimpleFieldAssign//sourceId:14452_2
                    }
                    if (string != null) {
                        oneItem.setSpaceId(string);//SimpleFieldAssign//sourceId:107918_2
                    }

                    listStatusCheckItem.add(oneItem);
                }//sourceId:19543_1
            }

            /*1-1-22批量新增状态校验项[951]   */

            bOOLEAN = mStatusCheckItemService.batchAddCheckItemStat(listStatusCheckItem)/*vcase invoke 本地 method 方法调用;*/;


        }

//步骤3: 1-2-08查询角色详情 - queryRoleDetail
        SceneRole sceneRole = null;
        QueryRoleDetailReq queryRoleDetailReq = new QueryRoleDetailReq();
        queryRoleDetailReq.setRoleCode("ADMIN");//CUSTOM_CONVENTION//sourceId:256098_1
        queryRoleDetailReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:256099_1

        /*1-2-08查询角色详情（查组空间管理员普通角色ID）[170]   */
        Assert.isNull(queryRoleDetailReq.getRoleCode(), "D1-2新增空间（平台）-1-2-08查询角色详情（查组空间管理员普通角色ID）-角色标识不能为空", false);
        Assert.isNull(queryRoleDetailReq.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-08查询角色详情（查组空间管理员普通角色ID）-主体生命周期不能为空", false);
        sceneRole = mSceneRoleService.queryRoleDetail(queryRoleDetailReq)/*vcase invoke 本地 method 方法调用;*/;
        Assert.isTrue(sceneRole == null || sceneRole.getRoleId() == null, "找不到数据，系统异常", false);


//步骤4: 1-2-11查询权限详情 - queryPowerDetail
        Privacy privacy = null;
        QueryPowerDetailReq queryPowerDetailReq = new QueryPowerDetailReq();
        queryPowerDetailReq.setPrivacyCode("POWER_DISTRIBUTION_MGT_POWER");//CUSTOM_CONVENTION//sourceId:255995_1
        queryPowerDetailReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:256004_1

        /*1-2-11查询权限分配管理权限[120]   */
        Assert.isNull(queryPowerDetailReq.getPrivacyCode(), "D1-2新增空间（平台）-1-2-11查询权限分配管理权限-权限标识不能为空", false);
        Assert.isNull(queryPowerDetailReq.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-11查询权限分配管理权限-主体生命周期不能为空", false);
        privacy = mPrivacyService.queryPowerDetail(queryPowerDetailReq)/*vcase invoke 本地 method 方法调用;*/;
        Assert.isTrue(privacy == null || privacy.getPrivacyId() == null, "找不到数据，系统异常", false);


//步骤5: 1-2-12新增权限分配 - addTributPower
        String string_4 = null;
        if (privacy != null) {
            PrivacyDistribution privacyDistribution = new PrivacyDistribution();
            privacyDistribution.setIsportPrivacy("TRUE");//sourceId:255965_1
            privacyDistribution.setIsDataPrivacy("FALSE");//sourceId:255967_1
            privacyDistribution.setPrivacyCategory("COMMON_PRIVACY");//sourceId:255969_1
            privacyDistribution.setBusinessPurposes("BROWSE");//sourceId:255970_1
            privacyDistribution.setTypeCode("ROLE");//sourceId:255961_1
            privacyDistribution.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:255963_1
            if (privacy != null) {
                privacyDistribution.setPrivacyId(privacy.getPrivacyId());//SimpleFieldAssign//sourceId:255959_1
                privacyDistribution.setPrivacyCode(privacy.getPrivacyCode());//SimpleFieldAssign//sourceId:255960_1
                privacyDistribution.setPrivacyRoute(privacy.getPrivacyRoute());//SimpleFieldAssign//sourceId:255966_1
            }
            if (sceneRole != null) {
                privacyDistribution.setAllocationObjectId(sceneRole.getRoleId());//SimpleFieldAssign//sourceId:255962_1
            }
            if (string != null) {
                privacyDistribution.setSpaceId(string);//SimpleFieldAssign//sourceId:257487_1
            }
            if (reqDto != null) {
                privacyDistribution.setAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:257488_1
            }

            /*1-2-12权限分配管理权限给空间管理员[473]   */
            Assert.isNull(privacyDistribution.getPrivacyId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-权限ID不能为空", false);
            Assert.isNull(privacyDistribution.getPrivacyCode(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-权限标识不能为空", false);
            Assert.isNull(privacyDistribution.getIsportPrivacy(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-是否接口权限不能为空", false);
            Assert.isNull(privacyDistribution.getIsDataPrivacy(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-是否数据权限不能为空", false);
            Assert.isNull(privacyDistribution.getTypeCode(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-分配对象类型编码不能为空", false);
            Assert.isNull(privacyDistribution.getAllocationObjectId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-分配对象ID不能为空", false);
            Assert.isNull(privacyDistribution.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-主体生命周期不能为空", false);
            Assert.isNull(privacyDistribution.getSpaceId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-创建于空间ID不能为空", false);
            Assert.isNull(privacyDistribution.getAppId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给空间管理员-创建于联盟应用ID不能为空", false);
            string_4 = mPrivacyDistributionService.addTributPower(privacyDistribution)/*vcase invoke 本地 method 方法调用;*/;


        }

//步骤6: 1-2-08查询角色详情 - queryRoleDetail
        SceneRole sceneRole_2 = null;
        QueryRoleDetailReq queryRoleDetailReq_1 = new QueryRoleDetailReq();
        queryRoleDetailReq_1.setRoleCode("ORG_ADMIN");//CUSTOM_CONVENTION//sourceId:1444564_1
        queryRoleDetailReq_1.setIsIdentity("FALSE");//sourceId:1444565_1
        queryRoleDetailReq_1.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1444566_1

        /*1-2-08查询角色详情（查组组织架构管理员角色ID）[170]   */
        Assert.isNull(queryRoleDetailReq_1.getRoleCode(), "D1-2新增空间（平台）-1-2-08查询角色详情（查组组织架构管理员角色ID）-角色标识不能为空", false);
        Assert.isNull(queryRoleDetailReq_1.getIsIdentity(), "D1-2新增空间（平台）-1-2-08查询角色详情（查组组织架构管理员角色ID）-是否身份角色不能为空", false);
        Assert.isNull(queryRoleDetailReq_1.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-08查询角色详情（查组组织架构管理员角色ID）-主体生命周期不能为空", false);
        sceneRole_2 = mSceneRoleService.queryRoleDetail(queryRoleDetailReq_1)/*vcase invoke 本地 method 方法调用;*/;


//步骤7: 1-2-11查询权限详情 - queryPowerDetail
        Privacy privacy_2 = null;
        QueryPowerDetailReq queryPowerDetailReq_1 = new QueryPowerDetailReq();
        queryPowerDetailReq_1.setPrivacyCode("MGT_ORG_POWER");//CUSTOM_CONVENTION//sourceId:1444597_1
        queryPowerDetailReq_1.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1444606_1

        /*1-2-11查询组织架构管理权限[120]   */
        Assert.isNull(queryPowerDetailReq_1.getPrivacyCode(), "D1-2新增空间（平台）-1-2-11查询组织架构管理权限-权限标识不能为空", false);
        Assert.isNull(queryPowerDetailReq_1.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-11查询组织架构管理权限-主体生命周期不能为空", false);
        privacy_2 = mPrivacyService.queryPowerDetail(queryPowerDetailReq_1)/*vcase invoke 本地 method 方法调用;*/;


//步骤8: 1-2-12新增权限分配 - addTributPower
        String string_6 = null;
        if (privacy_2 != null) {
            PrivacyDistribution privacyDistribution_1 = new PrivacyDistribution();
            privacyDistribution_1.setIsportPrivacy("TRUE");//sourceId:1444615_1
            privacyDistribution_1.setIsDataPrivacy("FALSE");//sourceId:1444617_1
            privacyDistribution_1.setPrivacyCategory("COMMON_PRIVACY");//sourceId:1444619_1
            privacyDistribution_1.setBusinessPurposes("BROWSE");//sourceId:1444620_1
            privacyDistribution_1.setTypeCode("ROLE");//sourceId:1444609_1
            privacyDistribution_1.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1444611_1
            if (privacy_2 != null) {
                privacyDistribution_1.setPrivacyId(privacy_2.getPrivacyId());//SimpleFieldAssign//sourceId:1444607_1
                privacyDistribution_1.setPrivacyCode(privacy_2.getPrivacyCode());//SimpleFieldAssign//sourceId:1444608_1
                privacyDistribution_1.setPrivacyRoute(privacy_2.getPrivacyRoute());//SimpleFieldAssign//sourceId:1444616_1
            }
            if (sceneRole_2 != null) {
                privacyDistribution_1.setAllocationObjectId(sceneRole_2.getRoleId());//SimpleFieldAssign//sourceId:1444610_1
            }
            if (string != null) {
                privacyDistribution_1.setSpaceId(string);//SimpleFieldAssign//sourceId:1444612_1
            }
            if (reqDto != null) {
                privacyDistribution_1.setAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:1444613_1
            }

            /*1-2-12权限分配管理权限给组织架构管理员[473]   */
            Assert.isNull(privacyDistribution_1.getPrivacyId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-权限ID不能为空", false);
            Assert.isNull(privacyDistribution_1.getPrivacyCode(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-权限标识不能为空", false);
            Assert.isNull(privacyDistribution_1.getIsportPrivacy(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-是否接口权限不能为空", false);
            Assert.isNull(privacyDistribution_1.getIsDataPrivacy(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-是否数据权限不能为空", false);
            Assert.isNull(privacyDistribution_1.getTypeCode(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-分配对象类型编码不能为空", false);
            Assert.isNull(privacyDistribution_1.getAllocationObjectId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-分配对象ID不能为空", false);
            Assert.isNull(privacyDistribution_1.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-主体生命周期不能为空", false);
            Assert.isNull(privacyDistribution_1.getSpaceId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-创建于空间ID不能为空", false);
            Assert.isNull(privacyDistribution_1.getAppId(), "D1-2新增空间（平台）-1-2-12权限分配管理权限给组织架构管理员-创建于联盟应用ID不能为空", false);
            string_6 = mPrivacyDistributionService.addTributPower(privacyDistribution_1)/*vcase invoke 本地 method 方法调用;*/;


        }

//步骤9: 1-2-08查询角色详情 - queryRoleDetail
        SceneRole sceneRole_4 = null;
        QueryRoleDetailReq queryRoleDetailReq_2 = new QueryRoleDetailReq();
        queryRoleDetailReq_2.setRoleCode("DEPT_LEADER");//CUSTOM_CONVENTION//sourceId:256102_1
        queryRoleDetailReq_2.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:256103_1

        /*1-2-08查询角色详情（查分管领导业务角色ID）[170]   */
        Assert.isNull(queryRoleDetailReq_2.getRoleCode(), "D1-2新增空间（平台）-1-2-08查询角色详情（查分管领导业务角色ID）-角色标识不能为空", false);
        Assert.isNull(queryRoleDetailReq_2.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-08查询角色详情（查分管领导业务角色ID）-主体生命周期不能为空", false);
        sceneRole_4 = mSceneRoleService.queryRoleDetail(queryRoleDetailReq_2)/*vcase invoke 本地 method 方法调用;*/;
        Assert.isTrue(sceneRole_4 == null || sceneRole_4.getRoleId() == null, "找不到数据，系统异常", false);


//步骤10: 1-2-08查询角色详情 - queryRoleDetail
        SceneRole sceneRole_6 = null;
        QueryRoleDetailReq queryRoleDetailReq_3 = new QueryRoleDetailReq();
        queryRoleDetailReq_3.setRoleCode("INSPECTION_ROLE");//CUSTOM_CONVENTION//sourceId:989170_1
        queryRoleDetailReq_3.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:989171_1

        /*1-2-08查询角色详情（查视察角色业务角色ID）[170]   */

        sceneRole_6 = mSceneRoleService.queryRoleDetail(queryRoleDetailReq_3)/*vcase invoke 本地 method 方法调用;*/;
        Assert.isTrue(sceneRole_6 == null || sceneRole_6.getRoleId() == null, "找不到数据，系统异常", false);


//步骤11: 1-2-11查询权限详情 - queryPowerDetail
        Privacy privacy_4 = null;
        QueryPowerDetailReq queryPowerDetailReq_2 = new QueryPowerDetailReq();
        queryPowerDetailReq_2.setPrivacyCode("STRATEGY_PLAN_SCENE");//CUSTOM_CONVENTION//sourceId:256017_1
        queryPowerDetailReq_2.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:256026_1

        /*1-2-11查询浏览高层目标数据权限[120]   */
        Assert.isNull(queryPowerDetailReq_2.getPrivacyCode(), "D1-2新增空间（平台）-1-2-11查询浏览高层目标数据权限-权限标识不能为空", false);
        Assert.isNull(queryPowerDetailReq_2.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-11查询浏览高层目标数据权限-主体生命周期不能为空", false);
        privacy_4 = mPrivacyService.queryPowerDetail(queryPowerDetailReq_2)/*vcase invoke 本地 method 方法调用;*/;
        Assert.isTrue(privacy_4 == null || privacy_4.getPrivacyId() == null, "找不到数据，系统异常", false);


//步骤12: 1-2-12新增权限分配 - addTributPower
        String string_8 = null;
        if (privacy_4 != null) {
            PrivacyDistribution privacyDistribution_2 = new PrivacyDistribution();
            privacyDistribution_2.setIsportPrivacy("FALSE");//sourceId:255977_1
            privacyDistribution_2.setIsDataPrivacy("TRUE");//sourceId:255979_1
            privacyDistribution_2.setDataModel("STRATEGY_PLAN_SCENE");//sourceId:256031_1
            privacyDistribution_2.setPrivacyCategory("COMMON_PRIVACY");//sourceId:255981_1
            privacyDistribution_2.setBusinessPurposes("BROWSE");//sourceId:255982_1
            privacyDistribution_2.setTypeCode("ROLE");//sourceId:255973_1
            privacyDistribution_2.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:255975_1
            if (privacy_4 != null) {
                privacyDistribution_2.setPrivacyId(privacy_4.getPrivacyId());//SimpleFieldAssign//sourceId:255971_1
                privacyDistribution_2.setPrivacyCode(privacy_4.getPrivacyCode());//SimpleFieldAssign//sourceId:255972_1
                privacyDistribution_2.setPrivacyRoute(privacy_4.getPrivacyRoute());//SimpleFieldAssign//sourceId:255978_1
            }
            if (sceneRole_4 != null) {
                privacyDistribution_2.setAllocationObjectId(sceneRole_4.getRoleId());//SimpleFieldAssign//sourceId:255974_1
            }
            if (string != null) {
                privacyDistribution_2.setSpaceId(string);//SimpleFieldAssign//sourceId:257489_1
            }
            if (reqDto != null) {
                privacyDistribution_2.setAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:257490_1
            }

            /*1-2-12分配浏览高层目标数据权限给分管领导[473]   */
            Assert.isNull(privacyDistribution_2.getPrivacyId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-权限ID不能为空", false);
            Assert.isNull(privacyDistribution_2.getPrivacyCode(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-权限标识不能为空", false);
            Assert.isNull(privacyDistribution_2.getIsportPrivacy(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-是否接口权限不能为空", false);
            Assert.isNull(privacyDistribution_2.getIsDataPrivacy(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-是否数据权限不能为空", false);
            Assert.isNull(privacyDistribution_2.getTypeCode(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-分配对象类型编码不能为空", false);
            Assert.isNull(privacyDistribution_2.getAllocationObjectId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-分配对象ID不能为空", false);
            Assert.isNull(privacyDistribution_2.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-主体生命周期不能为空", false);
            Assert.isNull(privacyDistribution_2.getSpaceId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-创建于空间ID不能为空", false);
            Assert.isNull(privacyDistribution_2.getAppId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给分管领导-创建于联盟应用ID不能为空", false);
            string_8 = mPrivacyDistributionService.addTributPower(privacyDistribution_2)/*vcase invoke 本地 method 方法调用;*/;


        }

//步骤13: 1-2-12新增权限分配 - addTributPower
        String string_10 = null;
        if (privacy_4 != null) {
            PrivacyDistribution privacyDistribution_3 = new PrivacyDistribution();
            privacyDistribution_3.setIsportPrivacy("FALSE");//sourceId:989119_1
            privacyDistribution_3.setIsDataPrivacy("TRUE");//sourceId:989121_1
            privacyDistribution_3.setDataModel("STRATEGY_PLAN_SCENE");//sourceId:989122_1
            privacyDistribution_3.setPrivacyCategory("COMMON_PRIVACY");//sourceId:989123_1
            privacyDistribution_3.setBusinessPurposes("BROWSE");//sourceId:989124_1
            privacyDistribution_3.setTypeCode("ROLE");//sourceId:989113_1
            privacyDistribution_3.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:989115_1
            if (privacy_4 != null) {
                privacyDistribution_3.setPrivacyId(privacy_4.getPrivacyId());//SimpleFieldAssign//sourceId:989111_1
                privacyDistribution_3.setPrivacyCode(privacy_4.getPrivacyCode());//SimpleFieldAssign//sourceId:989112_1
                privacyDistribution_3.setPrivacyRoute(privacy_4.getPrivacyRoute());//SimpleFieldAssign//sourceId:989120_1
            }
            if (sceneRole_6 != null) {
                privacyDistribution_3.setAllocationObjectId(sceneRole_6.getRoleId());//SimpleFieldAssign//sourceId:989114_1
            }
            if (string != null) {
                privacyDistribution_3.setSpaceId(string);//SimpleFieldAssign//sourceId:989116_1
            }
            if (reqDto != null) {
                privacyDistribution_3.setAppId(reqDto.getSubjectionAppId());//SimpleFieldAssign//sourceId:989117_1
            }

            /*1-2-12分配浏览高层目标数据权限给视察角色[473]   */
            Assert.isNull(privacyDistribution_3.getPrivacyId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-权限ID不能为空", false);
            Assert.isNull(privacyDistribution_3.getPrivacyCode(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-权限标识不能为空", false);
            Assert.isNull(privacyDistribution_3.getIsportPrivacy(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-是否接口权限不能为空", false);
            Assert.isNull(privacyDistribution_3.getIsDataPrivacy(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-是否数据权限不能为空", false);
            Assert.isNull(privacyDistribution_3.getTypeCode(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-分配对象类型编码不能为空", false);
            Assert.isNull(privacyDistribution_3.getAllocationObjectId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-分配对象ID不能为空", false);
            Assert.isNull(privacyDistribution_3.getSubjectLifeCycle(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-主体生命周期不能为空", false);
            Assert.isNull(privacyDistribution_3.getSpaceId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-创建于空间ID不能为空", false);
            Assert.isNull(privacyDistribution_3.getAppId(), "D1-2新增空间（平台）-1-2-12分配浏览高层目标数据权限给视察角色-创建于联盟应用ID不能为空", false);
            string_10 = mPrivacyDistributionService.addTributPower(privacyDistribution_3)/*vcase invoke 本地 method 方法调用;*/;


        }

        AddSpaceRespDto retData = new AddSpaceRespDto();
        if (string_1 != null) {
            retData.setSpaceId(string_1);//SimpleFieldAssign//sourceId:28413_1
        }
        if (string_3 != null) {
            retData.setOrganizationId(string_3);//SimpleFieldAssign//sourceId:1499897_1
        }


        return retData;
    }

    /**
     * D1-2-07修改场景[301]
     * gen by moon at 8/10/2022, 3:21:48 AM
     */
    @Trace(operationName = "D1-2-07修改场景")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public UpdateSceneRespDto updateScene(UpdateSceneReqDto reqDto) {


        //virtualUsage 1-2-07修改场景  1720
        boolean bOOLEAN;
        Scene scene = new Scene();
        if (reqDto != null) {
            scene.setSceneId(reqDto.getSceneId());//sourceId:15046_1_1720
            scene.setSenceCode(reqDto.getSenceCode());//sourceId:15047_1_1720
            scene.setSceneName(reqDto.getSceneName());//sourceId:15048_1_1720
            scene.setSceneRemark(reqDto.getSceneRemark());//sourceId:15049_1_1720
            scene.setSceneLogo(reqDto.getSceneLogo());//sourceId:15050_1_1720
            scene.setPlatformType(reqDto.getPlatformType());//sourceId:15052_1_1720
            scene.setAscriptionAppId(reqDto.getAscriptionAppId());//sourceId:33565_1_1720
            scene.setIsArchive(reqDto.getIsArchive());//sourceId:33566_1_1720
            scene.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:15051_1_1720
            scene.setArchiveInductionId(reqDto.getArchiveInductionId());//sourceId:33567_1_1720
            scene.setArchiveTime(reqDto.getArchiveTime());//sourceId:33568_1_1720
        }

        /*1-2-07修改场景[70]   */

        bOOLEAN = mSceneService.updateScene(scene);


        if ((reqDto != null && reqDto.getSubjectLifeCycle() != null && reqDto.getSubjectLifeCycle().equals("CURRENTLY_VALID"))) {
            //if(D1-2-07修改场景.主体生命周期 等于 当前有效)  1722

            List<Space> listSpace = new ArrayList<>();
            QuerySpaceListReq querySpaceListReq = new QuerySpaceListReq();
            if (reqDto != null) {
                querySpaceListReq.setSubjectionSceneId(reqDto.getSceneId());//sourceId:46877_1_1723
            }

            /*1-2-04查询空间列表[60]   */

            listSpace = mSpaceService.querySpaceList(querySpaceListReq);


//ModelCode: batchClearSpaceInfoFromRedis
            BatchClearSpaceInfoFromRedisRespDto batchClearSpaceInfoFromRedisRes = null;
            if (listSpace != null && listSpace.size() > 0) {
                BatchClearSpaceInfoFromRedisReqDto batchClearSpaceInfoFromRedisReq = new BatchClearSpaceInfoFromRedisReqDto();
                batchClearSpaceInfoFromRedisReq.setSpaceInfoToRedisList(listSpace.stream().map(item -> item.getSpaceId())
                        .collect(Collectors.toList()));//sourceId:106781_1_5684

                /*M-批量Redis清空空间信息（特殊方法）[3103]  用于批量入参空间，清除对应空间在redis的缓存信息 */

                batchClearSpaceInfoFromRedisRes = nbBase.batchClearSpaceInfoFromRedis(batchClearSpaceInfoFromRedisReq);


            }
//processBranchName:正常结束 ,processBranchId:1725

        } else {
            //else  1726

//processBranchName:正常结束 ,processBranchId:1727

        }
        UpdateSceneRespDto retData = new UpdateSceneRespDto();


        return retData;
    }

    /**
     * D1-2查询场景列表[299]
     * gen by moon at 8/10/2022, 3:21:46 AM
     */
    @Trace(operationName = "D1-2查询场景列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySceneListRespDto querySceneList(QuerySceneListReqDto reqDto) {


        List<Scene> listScene_1 = new ArrayList<>();
        List<UnionApp> listUnionApp_1 = new ArrayList<>();
//步骤0: 1-2-07查询场景列表 - querySceneList
        List<Scene> listScene = new ArrayList<>();
        QuerySceneListReq querySceneListReq = new QuerySceneListReq();
        if (reqDto != null) {
            querySceneListReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:13525_1
            querySceneListReq.setPlatformType(reqDto.getPlatformType());//sourceId:13528_1
            querySceneListReq.setIsArchive(reqDto.getIsArchive());//sourceId:15167_1
        }

        /*1-2-07查询场景列表[683]   */

        listScene = mSceneService.querySceneList(querySceneListReq);

        listScene_1 = listScene;

//步骤1: 1-2-06批量查询联盟应用列表 - batchQueryApp
        List<UnionApp> listUnionApp = new ArrayList<>();
        if (listScene != null && listScene.size() > 0) {
            BatchQueryAppReq batchQueryAppReq = new BatchQueryAppReq();
            batchQueryAppReq.setUnionAppList(listScene.stream().map(item -> item.getAscriptionAppId())
                    .collect(Collectors.toList()));//sourceId:44324_1

            /*1-2-06批量查询联盟应用列表[1548]   */

            listUnionApp = mUnionAppService.batchQueryApp(batchQueryAppReq);

            listUnionApp_1 = listUnionApp;
        }

        QuerySceneListRespDto retData = new QuerySceneListRespDto();
        //数据集融合
        if (listScene_1 != null && !CollectionUtil.isEmpty(listScene_1)) {
            for (Scene scene : listScene_1) {
                SenceDto retElm = new SenceDto();
                retElm.setSceneId(scene.getSceneId());//sourceId:5095_2
                retElm.setSenceCode(scene.getSenceCode());//sourceId:5096_2
                retElm.setSceneName(scene.getSceneName());//sourceId:5097_2
                retElm.setSceneRemark(scene.getSceneRemark());//sourceId:14995_2
                retElm.setSceneLogo(scene.getSceneLogo());//sourceId:14996_2
                retElm.setPlatformType(scene.getPlatformType());//sourceId:14998_2
                retElm.setAscriptionAppId(scene.getAscriptionAppId());//sourceId:14997_2
                retElm.setSubjectLifeCycle(scene.getSubjectLifeCycle());//sourceId:5098_2
                retElm.setOperationInductionId(scene.getOperationInductionId());//sourceId:5099_2
                retElm.setOperateTime(scene.getOperateTime());//sourceId:5100_2
                retData.getSenceList().add(retElm);
                if (listUnionApp_1 != null) {
                    for (UnionApp unionApp : listUnionApp_1) {
                        if (unionApp.getAppId().equals(scene.getAscriptionAppId())) {
                            retElm.setAppName(unionApp.getAppName());//sourceId:20899_2
                        }
                    }
                }

            }
        }//sourceId:13538_1


        return retData;
    }

    /**
     * D1-2查空间详情(公共)[402]
     * gen by moon at 10/25/2022, 9:38:42 AM
     */
    @Trace(operationName = "D1-2查空间详情(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySpaceDetailComRespDto querySpaceDetailCom(QuerySpaceDetailComReqDto reqDto) {


        Space space_1 = null;
        Scene scene_1 = null;
        UnionApp unionApp_1 = null;
//步骤0: 1-2-04查询空间详情 - querySpaceDetail
        Space space = null;
        QuerySpaceDetailReq querySpaceDetailReq = new QuerySpaceDetailReq();
        if (reqDto != null) {
            querySpaceDetailReq.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:15898_1
            querySpaceDetailReq.setSpaceCode(reqDto.getSpaceCode());//SimpleFieldAssign//sourceId:32578_1
            querySpaceDetailReq.setOrganizationNumber(reqDto.getOrganizationNumber());//SimpleFieldAssign//sourceId:32579_1
            querySpaceDetailReq.setSpaceLogo(reqDto.getSpaceLogo());//SimpleFieldAssign//sourceId:35973_1
        }

        /*1-2-04查询空间详情[161]   */

        space = mSpaceService.querySpaceDetail(querySpaceDetailReq);


        space_1 = space;

//步骤1: 1-2-07查询场景详情 - querySceneDetail
        Scene scene = null;
        if (space != null) {
            QuerySceneDetailReq querySceneDetailReq = new QuerySceneDetailReq();
            querySceneDetailReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:51158_1
            if (space != null) {
                querySceneDetailReq.setSceneId(space.getSubjectionSceneId());//SimpleFieldAssign//sourceId:32619_1
            }

            /*1-2-07查询场景详情[169]   */
            Assert.isNull(querySceneDetailReq.getSceneId(), "D1-2查空间详情(公共)-1-2-07查询场景详情-场景ID不能为空", false);
            scene = mSceneService.querySceneDetail(querySceneDetailReq);


            scene_1 = scene;
        }

//步骤2: 1-2-06查询联盟应用详情 - queryAppDetail
        UnionApp unionApp = null;
        if (space != null) {
            QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
            if (space != null) {
                queryAppDetailReq.setAppId(space.getSubjectionAppId());//SimpleFieldAssign//sourceId:32641_1
            }

            /*1-2-06查询联盟应用详情[168]   */
            Assert.isNull(queryAppDetailReq.getAppId(), "D1-2查空间详情(公共)-1-2-06查询联盟应用详情-应用ID不能为空", false);
            unionApp = mUnionAppService.queryAppDetail(queryAppDetailReq);


            unionApp_1 = unionApp;
        }

        QuerySpaceDetailComRespDto retData = new QuerySpaceDetailComRespDto();
        if (space_1 != null) {
            retData.setSpaceId(space_1.getSpaceId());//SimpleFieldAssign//sourceId:15917_1
            retData.setSpaceCode(space_1.getSpaceCode());//SimpleFieldAssign//sourceId:43412_1
            retData.setOrganizationNumber(space_1.getOrganizationNumber());//SimpleFieldAssign//sourceId:32583_1
            retData.setSpaceName(space_1.getSpaceName());//SimpleFieldAssign//sourceId:15919_1
            retData.setAbbreviation(space_1.getAbbreviation());//SimpleFieldAssign//sourceId:15920_1
            retData.setSpaceLogo(space_1.getSpaceLogo());//SimpleFieldAssign//sourceId:15921_1
            retData.setSpaceCopyRight(space_1.getSpaceCopyRight());//SimpleFieldAssign//sourceId:15922_1
            retData.setPlatformType(space_1.getPlatformType());//SimpleFieldAssign//sourceId:15924_1
            retData.setIsInvalid(space_1.getIsInvalid());//SimpleFieldAssign//sourceId:15927_1
            retData.setIsInvalidReason(space_1.getIsInvalidReason());//SimpleFieldAssign//sourceId:15928_1
            retData.setIsInvalidTime(space_1.getIsInvalidTime());//SimpleFieldAssign//sourceId:15929_1
            retData.setInvalidType(space_1.getInvalidType());//SimpleFieldAssign//sourceId:15930_1
            retData.setSubjectionSceneId(space_1.getSubjectionSceneId());//SimpleFieldAssign//sourceId:15931_1
            retData.setSubjectionAppId(space_1.getSubjectionAppId());//SimpleFieldAssign//sourceId:32584_1
            retData.setCreateInductionId(space_1.getCreateInductionId());//SimpleFieldAssign//sourceId:15925_1
            retData.setCreateTime(space_1.getCreateTime());//SimpleFieldAssign//sourceId:15926_1
            retData.setAscriptionSpaceId(space_1.getAscriptionSpaceId());//SimpleFieldAssign//sourceId:15932_1
            retData.setAppId(space_1.getAppId());//SimpleFieldAssign//sourceId:15933_1
        }
        if (scene_1 != null) {
            retData.setSenceCode(scene_1.getSenceCode());//SimpleFieldAssign//sourceId:43410_1
            retData.setSceneName(scene_1.getSceneName());//SimpleFieldAssign//sourceId:32671_1
        }
        if (unionApp_1 != null) {
            retData.setAppCode(unionApp_1.getAppCode());//SimpleFieldAssign//sourceId:43411_1
            retData.setAppName(unionApp_1.getAppName());//SimpleFieldAssign//sourceId:32672_1
        }


        return retData;
    }

    /**
     * D1-2查场景列表(边界)[1313]
     * gen by moon at 10/2/2022, 12:02:49 AM
     */
    @Trace(operationName = "D1-2查场景列表(边界)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySceneListBorderRespDto querySceneListBorder(QuerySceneListBorderReqDto reqDto) {


        List<Scene> listScene_1 = new ArrayList<>();
//步骤0: 1-2-07查询场景列表 - querySceneList
        List<Scene> listScene = new ArrayList<>();
        QuerySceneListReq querySceneListReq = new QuerySceneListReq();
        if (reqDto != null) {
            querySceneListReq.setPlatformType(reqDto.getPlatformType());//SimpleFieldAssign//sourceId:33611_1
            querySceneListReq.setAscriptionAppId(reqDto.getAscriptionAppId());//SimpleFieldAssign//sourceId:30652_1
            querySceneListReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:30649_1
        }

        /*1-2-07查询场景列表[683]   */
        Assert.isNull(querySceneListReq.getSubjectLifeCycle(), "D1-2查场景列表(边界)-1-2-07查询场景列表-主体生命周期不能为空", false);
        listScene = mSceneService.querySceneList(querySceneListReq);


        listScene_1 = listScene;

        QuerySceneListBorderRespDto retData = new QuerySceneListBorderRespDto();
        retData.setSenceList(listScene_1.stream().map(item -> BeanUtil.toBean(item, SenceDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:30656_1


        return retData;
    }

    /**
     * D1-2查联盟应用列表(边界)[1308]
     * gen by moon at 10/2/2022, 12:02:35 AM
     */
    @Trace(operationName = "D1-2查联盟应用列表(边界)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QueryAppListBorderRespDto queryAppListBorder(QueryAppListBorderReqDto reqDto) {


        List<UnionApp> listUnionApp_1 = new ArrayList<>();
//步骤0: 1-2-06查询联盟应用列表 - queryAppList
        List<UnionApp> listUnionApp = new ArrayList<>();
        QueryAppListReq queryAppListReq = new QueryAppListReq();
        queryAppListReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:33609_1
        queryAppListReq.setPlatformType("TRUE");//sourceId:33610_1

        /*1-2-06查询联盟应用列表[68]   */
        Assert.isNull(queryAppListReq.getSubjectLifeCycle(), "D1-2查联盟应用列表(边界)-1-2-06查询联盟应用列表-主体生命周期不能为空", false);
        Assert.isNull(queryAppListReq.getPlatformType(), "D1-2查联盟应用列表(边界)-1-2-06查询联盟应用列表-是否平台应用不能为空", false);
        listUnionApp = mUnionAppService.queryAppList(queryAppListReq);


        listUnionApp_1 = listUnionApp;

        QueryAppListBorderRespDto retData = new QueryAppListBorderRespDto();
        retData.setUnionAppList(listUnionApp_1.stream().map(item -> BeanUtil.toBean(item, UnionAppDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:30644_1


        return retData;
    }

    /**
     * D1-2-07新增场景[297]
     * gen by moon at 8/10/2022, 3:21:44 AM
     */
    @Trace(operationName = "D1-2-07新增场景")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public AddSceneRespDto addScene(AddSceneReqDto reqDto) {


        String string_1 = null;
//步骤0: 1-2-07新增场景 - addScene
        String string = null;
        Scene scene = new Scene();
        if (reqDto != null) {
            scene.setSenceCode(reqDto.getSenceCode());//sourceId:14993_1
            scene.setSceneName(reqDto.getSceneName());//sourceId:14994_1
            scene.setSceneRemark(reqDto.getSceneRemark());//sourceId:14995_1
            scene.setSceneLogo(reqDto.getSceneLogo());//sourceId:14996_1
            scene.setPlatformType(reqDto.getPlatformType());//sourceId:14998_1
            scene.setAscriptionAppId(reqDto.getAscriptionAppId());//sourceId:33553_1
            scene.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:33554_1
        }

        /*1-2-07新增场景[69]   */
        Assert.isNull(scene.getSenceCode(), "D1-2-07新增场景-1-2-07新增场景-场景编码不能为空", false);
        Assert.isNull(scene.getSceneName(), "D1-2-07新增场景-1-2-07新增场景-场景中文名称不能为空", false);
        Assert.isNull(scene.getPlatformType(), "D1-2-07新增场景-1-2-07新增场景-是否是平台不能为空", false);
        Assert.isNull(scene.getAscriptionAppId(), "D1-2-07新增场景-1-2-07新增场景-隶属联盟应用ID不能为空", false);
        string = mSceneService.addScene(scene);

        string_1 = string;

        AddSceneRespDto retData = new AddSceneRespDto();
        if (string_1 != null) {
            retData.setSceneId(string_1);//sourceId:28416_1
        }


        return retData;
    }

    /**
     * D1-2-07查询场景详情[303]
     * gen by moon at 8/13/2022, 2:52:32 PM
     */
    @Trace(operationName = "D1-2-07查询场景详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySceneDetailRespDto querySceneDetail(QuerySceneDetailReqDto reqDto) {


        Scene scene_1 = null;
        UnionApp unionApp_1 = null;
//步骤0: 1-2-07查询场景详情 - querySceneDetail
        Scene scene = null;
        QuerySceneDetailReq querySceneDetailReq = new QuerySceneDetailReq();
        if (reqDto != null) {
            querySceneDetailReq.setSceneId(reqDto.getSceneId());//sourceId:5182_1
            querySceneDetailReq.setSenceCode(reqDto.getSenceCode());//sourceId:15095_1
            querySceneDetailReq.setPlatformType(reqDto.getPlatformType());//sourceId:33506_1
            querySceneDetailReq.setIsArchive(reqDto.getIsArchive());//sourceId:33507_1
            querySceneDetailReq.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//sourceId:33508_1
        }

        /*1-2-07查询场景详情[169]   */

        scene = mSceneService.querySceneDetail(querySceneDetailReq);

        scene_1 = scene;

//步骤1: 1-2-06查询联盟应用详情 - queryAppDetail
        UnionApp unionApp = null;
        if (scene != null) {
            QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
            if (scene != null) {
                queryAppDetailReq.setAppId(scene.getAscriptionAppId());//sourceId:33469_1
            }

            /*1-2-06查询联盟应用详情[168]   */
            Assert.isNull(queryAppDetailReq.getAppId(), "D1-2-07查询场景详情-1-2-06查询联盟应用详情-应用ID不能为空", false);
            unionApp = mUnionAppService.queryAppDetail(queryAppDetailReq);

            unionApp_1 = unionApp;
        }

        QuerySceneDetailRespDto retData = new QuerySceneDetailRespDto();
        if (scene_1 != null) {
            retData.setSceneId(scene_1.getSceneId());//sourceId:12713_1
            retData.setSenceCode(scene_1.getSenceCode());//sourceId:12714_1
            retData.setSceneName(scene_1.getSceneName());//sourceId:12715_1
            retData.setSceneRemark(scene_1.getSceneRemark());//sourceId:12716_1
            retData.setSceneLogo(scene_1.getSceneLogo());//sourceId:12717_1
            retData.setSubjectLifeCycle(scene_1.getSubjectLifeCycle());//sourceId:12718_1
            retData.setPlatformType(scene_1.getPlatformType());//sourceId:12721_1
            retData.setAscriptionAppId(scene_1.getAscriptionAppId());//sourceId:15151_1
            retData.setOperationInductionId(scene_1.getOperationInductionId());//sourceId:12719_1
            retData.setOperateTime(scene_1.getOperateTime());//sourceId:12720_1
        }
        if (unionApp_1 != null) {
            retData.setAppName(unionApp_1.getAppName());//sourceId:33504_1
        }


        return retData;
    }

    /**
     * D1-2批量查询空间列表[2149]
     * gen by moon at 2022/7/3 下午5:15:04
     */
    @Trace(operationName = "D1-2批量查询空间列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public BatchQuerySpaceListBorderRespDto batchQuerySpaceListBorder(BatchQuerySpaceListBorderReqDto reqDto) {


        //步骤0: 1-2-04批量查询空间列表 - batchQuerySpaceList
        List<Space> listSpace = null;
        BatchQuerySpaceListReq batchQuerySpaceListReq = new BatchQuerySpaceListReq();
        if (reqDto != null) {
            batchQuerySpaceListReq.setSpaceList(reqDto.getSpaceList());//sourceId:62456_1
        }

        /*1-2-04批量查询空间列表[2151]   */
        listSpace = mSpaceService.batchQuerySpaceList(batchQuerySpaceListReq);


        BatchQuerySpaceListBorderRespDto retData = new BatchQuerySpaceListBorderRespDto();
        retData.setSpaceList(listSpace.stream().map(item -> BeanUtil.toBean(item, FrameworkSpaceDto.class)).collect(Collectors.toList()));//sourceId:62459_1


        return retData;
    }

    /**
     * D1-1批量查询空间(公共)[2149]
     * gen by moon at 10/25/2022, 9:38:46 AM
     */
    @Trace(operationName = "D1-1批量查询空间(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public BatchQuerySpaceComRespDto batchQuerySpaceCom(BatchQuerySpaceComReqDto reqDto) {


        List<Space> listSpace_1 = new ArrayList<>();
//步骤0: 1-2-04批量查询空间列表 - batchQuerySpaceList
        List<Space> listSpace = new ArrayList<>();
        BatchQuerySpaceListReq batchQuerySpaceListReq = new BatchQuerySpaceListReq();
        if (reqDto != null) {
            batchQuerySpaceListReq.setSpaceList(reqDto.getSpaceList());//list-field-assign//sourceId:62456_1
        }

        /*1-2-04批量查询空间列表[2151]   */

        listSpace = mSpaceService.batchQuerySpaceList(batchQuerySpaceListReq);


        listSpace_1 = listSpace;

        BatchQuerySpaceComRespDto retData = new BatchQuerySpaceComRespDto();
        retData.setSpaceList(listSpace_1.stream().map(item -> BeanUtil.toBean(item, FrameworkSpaceDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:62459_1


        return retData;
    }

    /**
     * D1-2查询联盟应用登录用详情(公共)[4201]
     * gen by moon at 10/2/2022, 6:10:33 AM
     */
    @Trace(operationName = "D1-2查询联盟应用登录用详情(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    @Override
    public QueryAppforLoginDetailComRespDto queryAppforLoginDetailCom(QueryAppforLoginDetailComReqDto reqDto) {


        UnionApp unionApp_1 = null;
//步骤0: 1-2-06查询联盟应用详情 - queryAppDetail
        UnionApp unionApp = null;
        QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
        if (CommonFunctionHelper.getSessionUrl() != null && CommonFunctionHelper.getSessionUrl().contains("localhost")) {
            //queryAppDetailReq.setWebsite("testnjevc.suzhi.link");
//          queryAppDetailReq.setWebsite("testszhct.suzhi.link");//sourceId:42749_1
            queryAppDetailReq.setWebsite("testxsz.suzhi.link");
//          queryAppDetailReq.setWebsite("hj.suzhi.link");
//          queryAppDetailReq.setWebsite("edu.suzhi.link");
        } else {
            queryAppDetailReq.setWebsite(CommonFunctionHelper.getSessionUrl());//ACCESS_ADDRESS//sourceId:259205_1
        }


        /*1-2-06查询联盟应用详情[168]   */
        Assert.isNull(queryAppDetailReq.getWebsite(), "D1-2查询联盟应用登录用详情(公共)-1-2-06查询联盟应用详情-网址不能为空", false);
        unionApp = mUnionAppService.queryAppDetail(queryAppDetailReq);
        Assert.isTrue(unionApp == null || unionApp.getUniqueSpaceId() == null, "返回值不能为空", false);

        unionApp_1 = unionApp;

//步骤1: M1-获取接收字段（特殊方法） - queryReceiveFieldDetail
        //ModelCode: receptionService
        QueryReceiveFieldDetailRespDto receptionServiceRes = null;
        QueryReceiveFieldDetailReqDto receptionServiceReq = new QueryReceiveFieldDetailReqDto();
        if (reqDto != null) {
            receptionServiceReq.setPhone(reqDto.getPhone());//SimpleFieldAssign//sourceId:259442_1
            receptionServiceReq.setRoleMemberCode(reqDto.getRoleMemberCode());//SimpleFieldAssign//sourceId:259443_1
            receptionServiceReq.setUserName(reqDto.getUserName());//SimpleFieldAssign//sourceId:259444_1
            receptionServiceReq.setPassword(reqDto.getPassword());//SimpleFieldAssign//sourceId:259445_1
            receptionServiceReq.setVerificationCode(reqDto.getVerificationCode());//SimpleFieldAssign//sourceId:259446_1
        }

        /*M1-获取接收字段（专门接收字段用于前端全部入参）[3715]  用于特殊方法接收上游入参。 */

        receptionServiceRes = nbBase.queryReceiveFieldDetail(receptionServiceReq);


        QueryAppforLoginDetailComRespDto retData = new QueryAppforLoginDetailComRespDto();
        if (unionApp_1 != null) {
            retData.setUniqueSpaceId(unionApp_1.getUniqueSpaceId());//SimpleFieldAssign//sourceId:259206_1
        }


        return retData;
    }

    /**
     * D1-2查询联盟应用详情(公共)[3268]
     * gen by moon at 5/22/2023, 3:33:22 AM
     */
    @Trace(operationName = "D1-2查询联盟应用详情(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QueryAppDetailComRespDto queryAppDetailCom(QueryAppDetailComReqDto reqDto) {


        UnionApp unionApp_1 = null;
//步骤0: 1-2-06查询联盟应用详情 - queryAppDetail
        UnionApp unionApp = null;
        QueryAppDetailReq queryAppDetailReq = new QueryAppDetailReq();
        queryAppDetailReq.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:125628_1
        if (reqDto != null) {
            queryAppDetailReq.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:947465_1
            queryAppDetailReq.setAppCode(reqDto.getAppCode());//SimpleFieldAssign//sourceId:125016_1
            queryAppDetailReq.setUniqueSpaceId(reqDto.getUniqueSpaceId());//SimpleFieldAssign//sourceId:952438_1
            queryAppDetailReq.setPlatformType(reqDto.getPlatformType());//SimpleFieldAssign//sourceId:952440_1
        }

        /*1-2-06查询联盟应用详情[168]   */
        Assert.isNull(queryAppDetailReq.getSubjectLifeCycle(), "D1-2查询联盟应用详情(公共)-1-2-06查询联盟应用详情-主体生命周期不能为空", false);
        unionApp = mUnionAppService.queryAppDetail(queryAppDetailReq)/*vcase invoke 本地 method 方法调用;*/;


        unionApp_1 = unionApp;

        QueryAppDetailComRespDto retData = new QueryAppDetailComRespDto();
        if (unionApp_1 != null) {
            retData.setAppId(unionApp_1.getAppId());//SimpleFieldAssign//sourceId:125021_1
            retData.setAppName(unionApp_1.getAppName());//SimpleFieldAssign//sourceId:776114_1
            retData.setUniqueSpaceId(unionApp_1.getUniqueSpaceId());//SimpleFieldAssign//sourceId:125022_1
            retData.setSenderMemberId(unionApp_1.getSenderMemberId());//SimpleFieldAssign//sourceId:947463_1
            retData.setOperationInductionId(unionApp_1.getOperationInductionId());//SimpleFieldAssign//sourceId:125023_1
        }


        return retData;
    }

    /**
     * D1-2查询空间列表(管理)(公共)[3315]
     * gen by moon at 1/2/2024, 7:59:58 AM
     */
    @Trace(operationName = "D1-2查询空间列表(管理)(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySpaceListComRespDto querySpaceListCom(QuerySpaceListComReqDto reqDto) {


        List<Space> listSpace_1 = new ArrayList<>();
//步骤0: 1-2-04查询空间列表 - querySpaceList
        List<Space> listSpace = new ArrayList<>();
        QuerySpaceListReq querySpaceListReq = new QuerySpaceListReq();
        querySpaceListReq.setIsInvalid("FALSE");//sourceId:128557_1

        /*1-2-04查询空间列表[60]   */
        Assert.isNull(querySpaceListReq.getIsInvalid(), "D1-2查询空间列表(管理)(公共)-1-2-04查询空间列表-是否失效不能为空", false);
        listSpace = mSpaceService.querySpaceList(querySpaceListReq)/*vcase invoke 本地 method 方法调用;*/;


        listSpace_1 = listSpace;

        QuerySpaceListComRespDto retData = new QuerySpaceListComRespDto();
        retData.setSpaceList(//objList-to-objLists
                listSpace_1.stream().map(item -> {
                    FrameworkSpaceDto elm = new FrameworkSpaceDto();
                    elm.setSpaceId(item.getSpaceId());//SimpleFieldAssign//sourceId:65299_2
                    elm.setSpaceName(item.getSpaceName());//SimpleFieldAssign//sourceId:65300_2
                    elm.setAbbreviation(item.getAbbreviation());//SimpleFieldAssign//sourceId:114822_2
                    elm.setCreateInductionId(item.getCreateInductionId());//SimpleFieldAssign//sourceId:142006_2
                    elm.setAppId(item.getSubjectionAppId());//SimpleFieldAssign//sourceId:114827_2
                    return elm;
                }).collect(Collectors.toList()));//objList-to-objLists//sourceId:128561_1


        return retData;
    }

    /**
     * D1查询空间信息详情(公共)[5423]
     * gen by moon at 2/4/2024, 1:41:58 AM
     */
    @Trace(operationName = "D1查询空间信息详情(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public QuerySpaceInfoDetailComRespDto querySpaceInfoDetailCom(QuerySpaceInfoDetailComReqDto reqDto) {


        Space space_1 = null;
//步骤0: 1-2-04查询空间详情 - querySpaceDetail
        Space space = null;
        QuerySpaceDetailReq querySpaceDetailReq = new QuerySpaceDetailReq();
        querySpaceDetailReq.setIsInvalid("FALSE");//sourceId:493273_1
        querySpaceDetailReq.setSubjectionAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID//sourceId:493330_1
        if (reqDto != null) {
            querySpaceDetailReq.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:493196_1
        }

        /*1-2-04查询空间详情[161]   */
        Assert.isNull(querySpaceDetailReq.getSpaceId(), "D1查询空间信息详情(公共)-1-2-04查询空间详情-空间ID不能为空", false);
        Assert.isNull(querySpaceDetailReq.getIsInvalid(), "D1查询空间信息详情(公共)-1-2-04查询空间详情-是否失效不能为空", false);
        Assert.isNull(querySpaceDetailReq.getSubjectionAppId(), "D1查询空间信息详情(公共)-1-2-04查询空间详情-隶属联盟应用ID不能为空", false);
        space = mSpaceService.querySpaceDetail(querySpaceDetailReq)/*vcase invoke 本地 method 方法调用;*/;
        Assert.isTrue(space == null || space.getSpaceId() == null, "找不到数据，系统异常", false);

        space_1 = space;

        QuerySpaceInfoDetailComRespDto retData = new QuerySpaceInfoDetailComRespDto();
        if (space_1 != null) {
            retData.setSpaceId(space_1.getSpaceId());//SimpleFieldAssign//sourceId:493334_1
            retData.setSpaceName(space_1.getSpaceName());//SimpleFieldAssign//sourceId:493335_1
            retData.setAbbreviation(space_1.getAbbreviation());//SimpleFieldAssign//sourceId:505407_1
            retData.setSpaceLogo(space_1.getSpaceLogo());//SimpleFieldAssign//sourceId:1522351_1
            retData.setSubjectionAppId(space_1.getSubjectionAppId());//SimpleFieldAssign//sourceId:600736_1
            retData.setCreateInductionId(space_1.getCreateInductionId());//SimpleFieldAssign//sourceId:600737_1
        }


        return retData;
    }

    /**
     * D1修改空间(公共)[5720]
     * gen by moon at 1/17/2023, 3:40:39 AM
     */
    @Trace(operationName = "D1修改空间(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public UpdateSpaceComRespDto updateSpaceCom(UpdateSpaceComReqDto reqDto) {


        //步骤0: 1-2-04修改空间 - updateSpace
        boolean bOOLEAN;
        Space space = new Space();
        if (reqDto != null) {
            space.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:613422_1
            space.setCreateTime(reqDto.getCreateTime());//SimpleFieldAssign//sourceId:613424_1
        }

        /*1-2-04修改空间[58]   */
        Assert.isNull(space.getSpaceId(), "D1修改空间(公共)-1-2-04修改空间-空间ID不能为空", false);
        bOOLEAN = mSpaceService.updateSpace(space);


        UpdateSpaceComRespDto retData = new UpdateSpaceComRespDto();


        return retData;
    }

    /**
     * D1执行分段查空间(公共)[9721]
     * gen by moon at 6/9/2024, 4:02:08 PM
     */
    @Trace(operationName = "D1执行分段查空间(公共)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Transactional(rollbackFor = Exception.class)
    @Override
    public ImplementSegQuerySpaceComRespDto implementSegQuerySpaceCom(ImplementSegQuerySpaceComReqDto reqDto) {


        ImplementSegQueryBaseDataSetComRespDto implementSegQueryBaseDataSetComRespDto_1 = null;
//步骤0: M1-获取接收字段（特殊方法） - queryReceiveFieldDetail
        //ModelCode: receptionService
        QueryReceiveFieldDetailRespDto receptionServiceRes = null;
        QueryReceiveFieldDetailReqDto receptionServiceReq = new QueryReceiveFieldDetailReqDto();
        if (reqDto != null) {
            receptionServiceReq.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:1859210_1
        }

        /*M1接收入参字段[3715]  用于特殊方法接收上游入参。 */
        Assert.isNull(receptionServiceReq.getAppId(), "D1执行分段查空间(公共)-M1接收入参字段-创建于联盟应用ID不能为空", false);
        receptionServiceRes = nbBase.queryReceiveFieldDetail(receptionServiceReq);


//步骤1: D1分段查询框架服务数据对象(业务原子) - implementSegQueryBaseDataSetCom
        ImplementSegQueryBaseDataSetComRespDto implementSegQueryBaseDataSetComRespDto = null;
        ImplementSegQueryBaseDataSetComReqDto implementSegQueryBaseDataSetComReqDto = new ImplementSegQueryBaseDataSetComReqDto();
        implementSegQueryBaseDataSetComReqDto.setRefCustomField1("appId");//CUSTOM_CONVENTION//sourceId:1845843_1
        implementSegQueryBaseDataSetComReqDto.setCustomField1("spaceId");//CUSTOM_CONVENTION//sourceId:1845859_1
        implementSegQueryBaseDataSetComReqDto.setCustomField2("spaceName");//CUSTOM_CONVENTION//sourceId:1845860_1
        implementSegQueryBaseDataSetComReqDto.setCustomField3("createInductionId");//CUSTOM_CONVENTION//sourceId:1845861_1
        if (reqDto != null) {
            implementSegQueryBaseDataSetComReqDto.setBusinessDataSetTableName(reqDto.getBusinessDataSetTableName());//SimpleFieldAssign//sourceId:1845837_1
            implementSegQueryBaseDataSetComReqDto.setDatasNum(reqDto.getDatasNum());//SimpleFieldAssign//sourceId:1845838_1
            implementSegQueryBaseDataSetComReqDto.setOrderFieldName(reqDto.getOrderFieldName());//SimpleFieldAssign//sourceId:1845839_1
            implementSegQueryBaseDataSetComReqDto.setOrderRule(reqDto.getOrderRule());//SimpleFieldAssign//sourceId:1845840_1
            implementSegQueryBaseDataSetComReqDto.setBusinessDataSetPrimaryKeyName(reqDto.getBusinessDataSetPrimaryKeyName());//SimpleFieldAssign//sourceId:1845841_1
            implementSegQueryBaseDataSetComReqDto.setLastDataObjectId(reqDto.getLastDataObjectId());//SimpleFieldAssign//sourceId:1845842_1
            implementSegQueryBaseDataSetComReqDto.setRefCustomFieldValue1(reqDto.getAppId());//SimpleFieldAssign//sourceId:1845844_1
        }

        /*D1分段查询框架服务数据对象(业务原子)[9689]   */
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getBusinessDataSetTableName(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-数据对象表名不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getDatasNum(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-数据条数不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getOrderFieldName(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-排序字段名不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getOrderRule(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-排序规则不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getBusinessDataSetPrimaryKeyName(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-数据对象主键名不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getRefCustomField1(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-入参自定义字段1不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getRefCustomFieldValue1(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-入参自定义字段值1不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getCustomField1(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-自定义字段1不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getCustomField2(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-自定义字段2不能为空", false);
        Assert.isNull(implementSegQueryBaseDataSetComReqDto.getCustomField3(), "D1执行分段查空间(公共)-D1分段查询框架服务数据对象(业务原子)-自定义字段3不能为空", false);
        implementSegQueryBaseDataSetComRespDto = businessAtomService.implementSegQueryBaseDataSetCom(implementSegQueryBaseDataSetComReqDto)/*vcase invoke isSameApp*/;


        implementSegQueryBaseDataSetComRespDto_1 = implementSegQueryBaseDataSetComRespDto;

        ImplementSegQuerySpaceComRespDto retData = new ImplementSegQuerySpaceComRespDto();
        if (implementSegQueryBaseDataSetComRespDto_1 != null) {
            retData.setSpaceList(//objList-to-objLists
                    implementSegQueryBaseDataSetComRespDto_1.getBaseDataList().stream().map(item -> {
                        FrameworkSpaceDto elm = new FrameworkSpaceDto();
                        if (item != null) {
                            elm.setSpaceId(item.getCustomField1());//SimpleFieldAssign//sourceId:372574_2
                            elm.setSpaceName(item.getCustomField2());//SimpleFieldAssign//sourceId:372575_2
                            elm.setCreateInductionId(item.getCustomField3());//SimpleFieldAssign//sourceId:372576_2
                        }
                        return elm;
                    }).collect(Collectors.toList()));//objList-to-objLists//sourceId:1859346_1
        }


        return retData;
    }
    //
}
